

<%@ page import="com.surelution.projects.crm.StationPicture" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'stationPicture.label', default: 'StationPicture')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${stationPictureInstance}">
            <div class="errors">
                <g:renderErrors bean="${stationPictureInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${stationPictureInstance?.id}" />
                <g:hiddenField name="version" value="${stationPictureInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="isDefault"><g:message code="stationPicture.isDefault.label" default="Is Default" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: stationPictureInstance, field: 'isDefault', 'errors')}">
                                    <g:checkBox name="isDefault" value="${stationPictureInstance?.isDefault}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="station"><g:message code="stationPicture.station.label" default="Station" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: stationPictureInstance, field: 'station', 'errors')}">
                                    ${stationPictureInstance?.station.name}
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="station"><g:message code="stationPicture.title.label" default="title" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: stationPictureInstance, field: 'picture.title', 'errors')}">
                                  <g:textField name="title" value="${stationPictureInstance.picture.title}" />
                                </td>
                            </tr>      
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="station"><g:message code="stationPicture.description.label" default="description" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: stationPictureInstance, field: 'description', 'errors')}">
                                  <g:textField name="description" value="${stationPictureInstance.picture.description}" />
                                </td>
                            </tr>
	                        <tr class="prop">
	                            <td valign="top" class="name"><g:message code="stationPicture.picture.label" default="picture" /></td>
	                            
	                            <td valign="top" class="value">					        		
	                            	<img style="width:200px;height:200px;" src="${resource(dir:'stationPicture/name')}/${stationPictureInstance.id}"/>
								</td>
	                        </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <sec:ifAnyGranted roles="ROLE_ADMIN">
	                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
					</sec:ifAnyGranted>
                </div>
            </g:form>
        </div>
    </body>
</html>
